// 注册成功时显示的对话框

// 关闭VSCode非必要警告
// ignore_for_file: camel_case_types, must_be_immutable, sized_box_for_whitespace, non_constant_identifier_names

import 'package:flutter/material.dart';
import 'package:project_award_statistics/utils/my_yaru_buttons/my_yaru_button_confirmed.dart';
import 'package:yaru/yaru.dart';

class DialogRegisterSuccess_Desktop extends StatelessWidget {
  String stu_name;  // 获取注册学生的姓名
  DialogRegisterSuccess_Desktop({
    super.key,
    required this.stu_name,
  });

  @override
  Widget build(BuildContext context) {
    return AlertDialog(
      backgroundColor: Theme.of(context).colorScheme.surface,
      // 设置对话框标题
      titlePadding: EdgeInsets.all(0),
      title: YaruDialogTitleBar(
        title: Text(
          "注册信息提示",
          style: TextStyle(
            fontSize: 18,
            fontWeight: FontWeight.bold,
          ),
        ),
        isClosable: false,   // 设置不可通过标题右上角关闭,只能通过按对话框进行关闭
      ),
      content: Container(
        height: 140,width: 400,   //设置对话框大小
        child: Column(     //设置行式布局
          children: [
            SizedBox(height: 15,),   //设置上下控件间间隔
            Center(
              child:
                Text(
                  "注册成功! 欢迎新用户:${stu_name}",
                  style: TextStyle(
                    fontSize: 25,
                  ),
                ),
            ),
            SizedBox(height: 45,),
            Container(
              height:40,
              width: 200,
              child:
                MyYaruButton_Confirmed(
                  text: "确认", 
                  onPressed: (){
                    Navigator.of(context).pop();  // 弹出对话框
                  },
                ),
            ),
          ],
        ),
      ),
    );
  }
}